package com.es.controller;


import com.es.service.PublishEventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * 模拟手机到货
 */
@RestController
public class EventController {

    @Autowired
    private PublishEventService publishEvent;

    /**
     * 手动触发手机到货事件
     *
     * @param phoneType 手机类型
     */
    @GetMapping("/phone/{phoneType}")
    public void phone(@PathVariable("phoneType") String phoneType) {
        publishEvent.publishEvent(phoneType);
    }
}
